package com.ruoyi.project.digital.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.digital.mapper.MoodMapper;
import com.ruoyi.project.digital.domain.Mood;
import com.ruoyi.project.digital.service.IMoodService;

/**
 * 心情列Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-28
 */
@Service
public class MoodServiceImpl extends ServiceImpl<MoodMapper, Mood> implements IMoodService
{

    /**
     * 查询心情列
     * 
     * @param id 心情列ID
     * @return 心情列
     */
    @Override
    public Mood selectMoodById(Long id)
    {
        return baseMapper.selectMoodById(id);
    }

    /**
     * 查询心情列列表
     * 
     * @param mood 心情列
     * @return 心情列
     */
    @Override
    public List<Mood> selectMoodList(Mood mood)
    {
        return baseMapper.selectMoodList(mood);
    }

    /**
     * 新增心情列
     * 
     * @param mood 心情列
     * @return 结果
     */
    @Override
    public int insertMood(Mood mood)
    {
        mood.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertMood(mood);
    }

    /**
     * 修改心情列
     * 
     * @param mood 心情列
     * @return 结果
     */
    @Override
    public int updateMood(Mood mood)
    {
        mood.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateMood(mood);
    }

    /**
     * 批量删除心情列
     * 
     * @param ids 需要删除的心情列ID
     * @return 结果
     */
    @Override
    public int deleteMoodByIds(Long[] ids)
    {
        return baseMapper.deleteMoodByIds(ids);
    }

    /**
     * 删除心情列信息
     * 
     * @param id 心情列ID
     * @return 结果
     */
    @Override
    public int deleteMoodById(Long id)
    {
        return baseMapper.deleteMoodById(id);
    }
}
